using System.Collections;
using System.Collections.Generic;
using DL.Combat.Base.Data;
using Messegers;
using UnityEngine;

namespace DL
{
    public class Enemy : MonoBehaviour
    {
        // Start is called before the first frame update
        [SerializeField]
        private Animator Animator;
        void Start()
        {
            Messenger<CombatActionSO, int, Transform, Transform>.AddListener(MessengerName.MSG_HurtEvt, Hurt);
        }

        // Update is called once per frame
        void Update()
        {
        
        }

        private void Hurt(CombatActionSO act, int hitcount, Transform attacker, Transform target)
        {
            if(!transform.Equals(target))return;
            Animator.CrossFade(act.ComboHitName[hitcount], act.AnimationNormalTime);
        }
    }
}
